package test.com.sms.selenium.singlepoint.util;

import org.openqa.selenium.By;

import test.com.sms.selenium.framework.SeleniumPageUtil;
import test.com.sms.selenium.util.SeleniumUtil;

public class SpNewIncidentEditAddressPageUtil extends SeleniumPageUtil {
	public final static By NIEA_LINK_SAVE = By.id("ctl44_btnSave");
	public final static By NIEA_LINK_DELETE = By.id("ctl44_btnDelete");
	public final static By NIEA_LINK_CLOSE = By.id("ctl44_btnClose");
	public final static By NIEA_TAB_ADDRESS = By.id("ctl44_tabMenu_ctl44_tabMenuLB_d55b15f7-3ccf-4ff4-a545-16ff123e43a5");
	public final static By NIEA_TAB_DETAILS = By.id("ctl44_tabMenu_ctl44_tabMenuLB_0a8494c6-d7ed-4273-9884-a790f3fc067d");
	public final static By NIEA_TAB_MAP = By.id("ctl44_tabMenu_ctl44_tabMenuLB_758c4d90-0ea7-4fda-a33d-da54774b5af8");
	public final static By NIEA_TAB_NOTES = By.id("ctl44_tabMenu_ctl44_tabMenuLB_56313eb1-8a9f-4571-9c24-f5e545dcbfe8");
	
	/** elements under defauls tab*/
	public final static By NIEA_SELECT_WAREHOUSE = By.id("ctl44_cboWarehouse");
	public final static By NIEA_SELECT_PERSON = By.id("ctl44_cboSalesPerson");
	
	public static final void waitFoNewIncidentEditAddressPageLoad(){
		SeleniumUtil.waitOnElements(new By[]{
				NIEA_LINK_SAVE, NIEA_LINK_DELETE, NIEA_LINK_CLOSE, NIEA_TAB_ADDRESS, NIEA_TAB_DETAILS, NIEA_TAB_MAP, NIEA_TAB_NOTES 
		});
		SeleniumUtil.assertTrue(SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(NIEA_LINK_SAVE)));
		SeleniumUtil.assertTrue(SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(NIEA_LINK_DELETE)));
		SeleniumUtil.assertTrue(SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(NIEA_LINK_CLOSE)));
		SeleniumUtil.assertTrue(SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(NIEA_TAB_ADDRESS)));
		SeleniumUtil.assertTrue(SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(NIEA_TAB_DETAILS)));
		SeleniumUtil.assertTrue(SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(NIEA_TAB_MAP)));
		SeleniumUtil.assertTrue(SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(NIEA_TAB_NOTES)));
	}
}
